  var app = getApp();
  var com = require('../../common.js');
  var utils = require('../../utils/util.js')
  Page({
    data: {
      state: true
    },
    onLoad: function(options) {
      var timestamp = Date.parse(new Date()),
      _this = this
      timestamp = utils.formatDate(timestamp)
      _this.setData({
        y: timestamp.substring(0, 4),
        m: timestamp.substring(5, 7),
        d: timestamp.substring(8, 10),
      })
      console.log("当前时间戳为：" + timestamp);
    },
    onReady: function() {},
    onShow: function() {
      var _this = this
      _this.onShopStatus()

    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    //获取信息
    onShopStatus() {
      var _this = this,
        i = _this.data.information
      com.link(app.link.onPowerState + wx.getStorageSync('store') + '.st', {
        code: 'meituan'
      }, function(res) {
        console.log(res)
        if (res.data.response.entrust) {
          _this.setData({
            y: res.data.response.entrust.create_time.substring(0, 4),
            m: res.data.response.entrust.create_time.substring(5, 7),
            d: res.data.response.entrust.create_time.substring(8, 10),
          })
        }
        _this.setData({
          state: res.data.response.entrust
        })
      }, "GET")
    },
    onJumpPage() {
      if (this.data.state) {
        wx.navigateTo({
          url: '/pages/onOrderBegin/onOrderBegin',
        })
        return false
      }
      wx.showModal({
        title: '提示',
        content: '确认是否签署',
        success(res) {
          if (res.confirm) {
            com.link(app.link.onSavePower + wx.getStorageSync('store') + '.st', {
              code: 'meituan'
            }, function(res) {
              console.log(res)
              if (res.data.state) {
                wx.showToast({
                  title: '签署成功',
                })
                setTimeout(() => {
                  wx.navigateTo({
                    url: '/pages/onOrderBegin/onOrderBegin',
                  })
                }, 1500)
              } else {
                wx.showModal({
                  content: res.data.message,
                  showCancel: false
                })
              }
            })
          }
        }
      })
    }
  })